\documentclass[smaller,red]{beamer}
\graphicspath{{img/}}
\usetheme{default}
\usepackage{listings}
\usepackage{color}
\usepackage{textcomp}
\definecolor{listinggray}{gray}{0.9}
\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
\lstset{
	backgroundcolor=\color{lbcolor},
	tabsize=4,
	rulecolor=,
	language=matlab,
        upquote=true,
        aboveskip={1\baselineskip},
        columns=fixed,
        showstringspaces=false,
        extendedchars=true,
        breaklines=true,
        prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
        frame=single,
        showtabs=false,
        showspaces=false,
        showstringspaces=false,
        identifierstyle=\ttfamily,
        keywordstyle=\color[rgb]{0,0,1},
        commentstyle=\color[rgb]{0.133,0.545,0.133},
        stringstyle=\color[rgb]{0.627,0.126,0.941},
}
\usepackage[center,small]{caption}
\usepackage{url,subfig,float,tabularx,multimedia}
\setbeamertemplate{footline}{
  \colorbox{red}{\color{white}
     \begin{tabularx}{0.98\textwidth}{ X X X }
          \includegraphics[height=0.3cm]{koc}& 
          \centering  \includegraphics[height=0.3cm]{cloud} ~ECOE506, May, 2011& 
          \hfill\insertpagenumber/\inserttotalframenumber\\
      \end{tabularx}
}
}
\setbeamertemplate{navigation symbols}[vertical]
\renewcommand*{\figurename}{}

\title{OPTICAL FLOW GAME USING LUCAS-KANADE ALGORITHM}
\author{Kaan Ak\c{s}it}
\institute{Ko\c{c} University, Optical Micro-systems Laboratory, Department of Electronic \& Electrical Engineering, Istanbul, Turkey
}
\date{ECOE506 Digital Image and Video Processing Lecture, May, 2011}                   

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

\section*{Outline} 
\begin{frame}
  \frametitle{Outline}
  \tableofcontents
\end{frame}

\section{Introduction}
\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Essence of the project}
  \begin{figure}
   \centering
   \resizebox{80mm}{!}{\movie[width=8cm,height=6cm,poster,showcontrols=true]{holograph}{RtnTfCy-ph0.flv}}
   \caption{Optical flow sample.}
   \label{fig:RtnTfCy-ph0}
  \end{figure}
  \tiny  Bulutus on Google Code, \url{http://code.google.com/p/bulutus/}, 2011.
\end{frame}

\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Concept of Lucas-Kanade Optical Flow Algorithm}
  \begin{block}{}
  \begin{itemize}
  \item<1-> Used optical flow algorithm found by Bruce D. Lucas and Takeo Kanade in early 80s.
  \item<1-> Used technologies: Python, Pygame and Google Code.
  \end{itemize}
  \begin{center}
  \resizebox{80mm}{!}{\includegraphics{lucaskanade}}\\
  \resizebox{35mm}{!}{\includegraphics{deneme}}\\
  \resizebox{30mm}{!}{\includegraphics{python}}
  \resizebox{30mm}{!}{\includegraphics{pygame}}\\
  \resizebox{20mm}{!}{\includegraphics{googlecode}}
  \end{center}

  \begin{center} One of the earlier optical flow concept. \end{center}
  \tiny Bouguet, J.Y.,Pyramidal implementation of the affine lucas kanade feature tracker, 2001.\\
  \tiny A. Murat Tekalp, Digital Video Processing, 1995.
  \end{block}
\end{frame}

\section{Aim of the game}
\begin{frame}
  \frametitle{Implementation}
  \framesubtitle{Optical-flow algorithm implementation}
  \begin{itemize}
  \item<1-> Little cloud trying to destroy the ships in his territory.
  \end{itemize}
  \begin{center}
  \resizebox{30mm}{!}{\includegraphics{cloudbig}}\\
  \resizebox{30mm}{!}{\includegraphics{shipbig}}
  \end{center}
  \tiny  Bulutus on Google Code, \url{http://code.google.com/p/bulutus/}, 2011.
\end{frame}

\section{Implementation of Optical-Flow Algorithm}
\begin{frame}
  \frametitle{Implementation}
  \framesubtitle{Optical-flow algorithm implementation}
  \tiny \lstset{language=Python,breaklines=true}
  \lstinputlisting[language=Python,firstline=118,lastline=138]{../src/main.py}
  \tiny  Bulutus on Google Code, \url{http://code.google.com/p/bulutus/}, 2011.
\end{frame}

\begin{frame}
  \frametitle{Implementation}
  \framesubtitle{Problems}
  \begin{itemize}
  \item<1-> Blurring is required to avoid the number of noise originated vectors ($smoothscale$ from Pygame: Gaussian filter).
  \item<1-> Without down sampling the required amount of computation is high. Not possible to process in real-time(Better to use C/C++).
  \item<1-> Window size lower than $10x10$ results in false dense motion vectors.
  \item<1-> At early, stages when two images are exactly the same, inverse was not possible until I have found $pinv$ (different then $inv$).
  \item<1-> Down sampling too much (more then $10$ times) results in unsatisfactory results. Maximum frame per second achieved is $11$.
  \end{itemize}
  \tiny  Bulutus on Google Code, \url{http://code.google.com/p/bulutus/}, 2011.
\end{frame}

\section{Results}
\section{Result of Optical-Flow Algorithm}
\begin{frame}
  \frametitle{Result}
  \framesubtitle{Optical-flow algorithm demo}
  \begin{figure}
   \centering
   \resizebox{80mm}{!}{\movie[width=8cm,height=6cm,poster,showcontrols=true]{holograph}{output1.mkv}}
   \caption{Result of optical-flow algorithm.}
   \label{fig:output1}
  \end{figure}
  \tiny  Bulutus on Google Code, \url{http://code.google.com/p/bulutus/}, 2011.
\end{frame}

\begin{frame}
  \frametitle{Result}
  \framesubtitle{Local optical-flow algorithm moving objects}
  \begin{figure}
   \centering
   \resizebox{80mm}{!}{\movie[width=8cm,height=6cm,poster,showcontrols=true]{holograph}{output2.mkv}}
   \caption{Result of local optical-flow algorithm.}
   \label{fig:output2}
  \end{figure}
  \tiny  Bulutus on Google Code, \url{http://code.google.com/p/bulutus/}, 2011.
\end{frame}

\section{Conclusion}
\begin{frame}
  \frametitle{Conclusion}
  \begin{itemize}
  \item<1-> The flow code is in place.
  \item<1-> Game is in early steps.
  \item<1-> Pyramidal implementation may increase the steadiness of the resultant flow vector.
  \end{itemize}  
  \begin{center}
  \resizebox{30mm}{!}{\includegraphics{cloudbig}}\\
  \end{center}
  \small Bulutus on Google Code, \url{http://code.google.com/p/bulutus/}, 2011.
\end{frame}

\begin{frame}
  \begin{block}{}
    \begin{center}
      \resizebox{90mm}{!}{Thank you very much for paying attention, Questions?}
    \end{center}
  \end{block}
\end{frame}

\end{document}
